home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / compguid / printing / winprin2 / loadme.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  1.3 KB  |  45 lines  |  [TEXT/ttxt]

  1. <<<
  2. -- Filename:
  3. --      loadme.sx
  4.  
  5. -- Other Files Required: 
  6. --       mywin.sx
  7.  
  8. -- Purpose:
  9. --        Test that prints a Window by printing its contents directly
  10. --     After the Window comes up, choose Print... from the file menu to print
  11.  
  12. -- Load in the printing module
  13. if (not isdefined Printer) do (process (new loader) "loadable/printing")
  14.  
  15. fileIn theScriptDir name:"mywin.sx"
  16.  
  17. global theStream := getStream theScriptDir "fishrt07.bmp" @readable
  18. global bm := importMedia theImportExportEngine theStream @image @dib @bitmap
  19. global bmShape := new twoDShape target:bm fill:blackBrush stroke:undefined
  20. bmShape.x := 0
  21. bmShape.y := 0
  22. plug theStream
  23.  
  24. theStream := getStream theScriptDir "k5.rtf" @readable
  25. global theText := importmedia theImportExportEngine theStream @text @rtf @richtext
  26. global theBox := new textpresenter boundary:(new Rect x2:350 y2:200) target:theText
  27. theBox.x := 300
  28. theBox.y := 50
  29.  
  30. global theOval := new Oval x2:120 y2:120
  31. global ovalShape := new twoDshape target:theOval stroke:blackbrush
  32. ovalShape.x := 300
  33. ovalShape.y := 300
  34.  
  35. enableitem thetitlecontainer.systemmenubar @print
  36.  
  37. global w := new MyWindowClass boundary:(new rect x1:0 y1:40 x2:640 y2:480)
  38. append w bmShape
  39. append w theBox
  40. append w ovalShape
  41.  
  42. show w
  43.  
  44. -- Choose Print... from the file menu to run the test
  45. >>>